package com.example.demo.domain.entity;

import java.io.Serializable;

/**
 * 试题分类的Model.
 * 对应数据库中的voj_problem_categories数据表.
 * 
 * @author Haozhe Xie
 */
public class ProblemCategory implements Serializable {
	/**
	 * ProblemCategory的默认构造函数
	 */
	public ProblemCategory() { }
	
	/**
	 * ProblemCategory的构造函数
	 */
	public ProblemCategory(String problemCategorySlug,
                           String problemCategoryName, int parentProblemCategoryId) {
		this.problemCategorySlug = problemCategorySlug;
		this.problemCategoryName = problemCategoryName;
		this.parentProblemCategoryId = parentProblemCategoryId;
	}
	
	/**
	 * ProblemCategory的构造函数
	 */
	public ProblemCategory(int problemCategoryId, String problemCategorySlug,
                           String problemCategoryName, int parentProblemCategoryId) {
		this(problemCategorySlug, problemCategoryName, parentProblemCategoryId);
		this.problemCategoryId = problemCategoryId;
	}
	
	/**
	 * 获取试题分类的唯一标识符.
	 * @return 试题分类的唯一标识符
	 */
	public int getProblemCategoryId() {
		return problemCategoryId;
	}

	/**
	 * 设置试题分类的唯一标识符.
	 * @param problemCategoryId - 试题分类的唯一标识符
	 */
	public void setProblemCategoryId(int problemCategoryId) {
		this.problemCategoryId = problemCategoryId;
	}
	
	/**
	 * 获取试题分类的别名.
	 * @return 试题分类的别名
	 */
	public String getProblemCategorySlug() {
		return problemCategorySlug;
	}

	/**
	 * 设置试题分类的别名.
	 * @param problemCategorySlug - 试题分类的别名
	 */
	public void setProblemCategorySlug(String problemCategorySlug) {
		this.problemCategorySlug = problemCategorySlug;
	}

	/**
	 * 获取试题分类的名称.
	 * @return 试题分类的名称
	 */
	public String getProblemCategoryName() {
		return problemCategoryName;
	}

	/**
	 * 设置试题分类的名称.
	 * @param problemCategoryName - 试题分类的名称
	 */
	public void setProblemCategoryName(String problemCategoryName) {
		this.problemCategoryName = problemCategoryName;
	}

	/**
	 * 获取试题分类的父类的唯一标识符.
	 * @return 试题分类的父类的唯一标识符
	 */
	public int getParentProblemCategoryId() {
		return parentProblemCategoryId;
	}

	/**
	 * 设置试题分类的父类的唯一标识符.
	 * @param parentProblemCategoryId - 试题分类的父类的唯一标识符
	 */
	public void setParentProblemCategory(int parentProblemCategoryId) {
		this.parentProblemCategoryId = parentProblemCategoryId;
	}

	public void setParentProblemCategoryId(int parentProblemCategoryId) {
		this.parentProblemCategoryId = parentProblemCategoryId;
	}

	public int getShowPriority() {
		return showPriority;
	}

	public void setShowPriority(int showPriority) {
		this.showPriority = showPriority;
	}

	@Override
	public String toString() {
		final StringBuffer sb = new StringBuffer("ProblemCategory{");
		sb.append("problemCategoryId=").append(problemCategoryId);
		sb.append(", problemCategorySlug='").append(problemCategorySlug).append('\'');
		sb.append(", problemCategoryName='").append(problemCategoryName).append('\'');
		sb.append(", parentProblemCategoryId=").append(parentProblemCategoryId);
		sb.append(", showPriority=").append(showPriority);
		sb.append('}');
		return sb.toString();
	}

	/**
	 * 试题分类的唯一标识符.
	 */
	private int problemCategoryId;
	
	/**
	 * 试题分类的别名.
	 */
	private String problemCategorySlug;
	
	/**
	 * 试题分类的名称.
	 */
	private String problemCategoryName;
	
	/**
	 * 试题分类的父类.
	 */
	private int parentProblemCategoryId;

	/**
	 * 试题分类的展示顺序.
	 */
	private int showPriority;

	/**
	 * 唯一的序列化标识符.
	 */
	private static final long serialVersionUID = 7093703712360669823L;
}
